index++// next file or folder in the current folder
Until _nil
End Fn
'~-----
'~DataBrowser Setting & Getting Data
'~'1
/*
This function is called via a callback procedure. This is
the only required routine to work with a DataBrowser control.
The DataBrowser asks you to setup some values for the cells
that it must display. Those values are set with specific functions
depending on the type of the cell to be updated.
With the same callback routine the DataBrowser may inform you
that a cell has been changed by the end user, so it is time
to get the value sent by the DataBrowser to update your
internal information.
*/
Clear Local Fn MyGetSetItemData( browser As ControlRef, itemID As DataBrowserItemID, columnPropID As DataBrowserPropertyID, itemData As DataBrowserItemDataRef, userChangedItemData As Boolean )
'~'9
Dim As OSStatus err
Dim As CFStringRef txt
Dim As IconRef iconH
Dim As FSSpec fSpec : fSpec = gFiles.spec(itemID)// copy info from the dynamic array...
Dim As OSType fType : fType = gFiles.type(itemID)// ... in local variables
Dim As OSType fCrea : fCrea = gFiles.creator(ItemID)
Fn InstallDataBrowserCallbacks( browser )// install the callback routines
Fn ConfigureDataBrowser( browser )// Configure the DataBrowser
err = Fn SetKeyboardFocus( wRef, browser, _kControlDataBrowserPart )// Set the keyboard focus
err = Fn SetWindowProperty( wRef, _myCreator, _myDataBrowser, Sizeof(browser), browser )// Store our custom DataBrowser ID as a window property
End If
Window _mainWnd// make the window visible
On Menu Fn doMenu
On Dialog Fn doDialog
Do
Handleevents
Until _nil
End Fn
// The start
Fn StartProgram
'~---
'~Applications Proc
/*
Entry points for the callback procedures (will be redirected to local fns)
*/
#If Def _FBUseDebugger
Troff
#Endif
goto "skip procs"
"GetSetItemDataProc"
Enterproc Fn GetSetItemDataProc( browser As ControlRef, itemID As DataBrowserItemID, prop As DataBrowserPropertyID, itemData As DataBrowserItemDataRef, changeValue As Boolean ) = OSStatus